#ifndef common_H
#define common_H

#include <stdint.h>

uint16_t Int8ToInt16BigEnd(uint8_t *array);
uint32_t Int8ToInt32BigEnd(uint8_t *array);
void Int16ToInt8BigEnd(uint16_t data, uint8_t *array);
void Int32ToInt8BigEnd(uint32_t data, uint8_t *array);

uint32_t CheckSumCalc(uint8_t *pData, uint32_t len);

void floatToBytes(float *floatValue, uint8_t *byteArray);
void bytesToFloat(float *floatValue, uint8_t *byteArray);

void systick_delay_us(uint32_t us);
void systick_delay_ms(uint32_t ms);
void systick_delay_s(uint32_t s);

void nop_delay_us(uint32_t us);

void swapEndianFloatAndCopy(float *source);
void swapEndianUint32AndCopy(uint32_t *dest);

#endif